package AlienArena::Server::RunState;

use 5.006;
use strict;
use warnings;
our $VERSION = '0.01';


sub new {
    my $class = shift;
    my $self = bless {},$class;
    my ($server) = @_;
    $self->_server($server);
    return $self;
}

sub server { shift->_server };
sub current_map { shift->_map };
sub is_up { shift->_is_up };
sub ping { shift->_ping };

sub _server {
    my $self = shift;
    return $self->{'_server'} = shift if @_;
    return $self->{'_server'};
}

sub _is_up {
    my $self = shift;
    return $self->{'_is_up'} = shift if @_;
    return $self->{'_is_up'};
}
sub _map {
    my $self = shift;
    return $self->{'_map'} = shift if @_;
    return $self->{'_map'};
}
sub _ping {
    my $self = shift;
    return $self->{'_ping'} = shift if @_;
    return $self->{'_ping'};
}

=head1 NAME

AlienArena::Server::RunState - Represents the current run state of a server

=head1 SYNOPSIS

    use AlienArena::Server;
    use AlienArena::Server::RunState;
    my $server = AlienArena::Server->new()
    my $state = AlienArena::Server::RunState->new($server);
    ...
    if ($state->is_up) {
        printf "Ping : %d, Map : %s\n", $state->ping, $state->current_map;
    }

=head1 METHODS

=head2 new($server)

=head2 server

=head2 current_map

=head2 is_up

=head2 ping

=head1 AUTHOR

Mark A. Jensen, C<< <maj -at- fortinbras -dot- us> >>

=head1 LICENSE AND COPYRIGHT

Copyright 2012 Mark A. Jensen.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.


=cut

1; # End of AlienArena::Server::RunState
